<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>迭代器iterator</title>
</head>
<body>
<script>
    //声明一个数组
    const arr = ['aa','bb','ccc'];
    for (let v of arr){
        console.log(v);
    }
    console.log(arr)

    let iterator = arr[Symbol.iterator]();

    //调用对象的next方法
    console.log(iterator.next());
    console.log(iterator.next());
    console.log(iterator.next());
    console.log(iterator.next());
</script>
</body>
</html>